using System;

namespace Zadanie326 // Zadanie 3.26
{
    class Program
    {
        static void Main(string[] args)
        {
            int j = 0; // licznik poszukiwanych liczb szeciocyfrowych

            for (Int32 i = 100000; i < 1000000; i++)
            {
                Int32 ptc = i/1000; // ptc - pierwsze 3 cyfry                
                Int32 otc = i%1000; // otc - ostatnie 3 cyfry

                if (ptc*ptc+otc*otc == i)
                {
                    Console.WriteLine(i + " = " + ptc + "*" + ptc + "+" + otc + "*" + otc); 
                    ++j;
                }
            }

            Console.WriteLine(); 
            Console.WriteLine("Znaleziono " + j + " liczb.");

            Console.Read(); // nacinij klawisz Enter
        }
    }
}
